class RspMsg(object):
    def __init__(self):
        self.code = 200
        self.msg = "ok"
        self.data = {}

    def error(self, code, msg):
        self.code = code
        self.msg = msg

    def ok(self):
        self.code = 200
        self.msg = "ok"

    def get_result(self):
        result = {}
        for name, value in vars(self).items():
            result[name] = value
            # result = result + str(value)
            # print('%s=%s' % (name, value))
        return result
